$(function(){


        // 获取屏幕尺寸
        


        //下载地址
        $("#iphone").on("click", function(){
            Statistics("ios")
            window.open(getDownLoadUrl(window.location.href).ios)
        })
        $("#android").on("click", function(){
            Statistics("Android")
            window.location.href = getDownLoadUrl(window.location.href).android
        })
        // 视频播放控制
        $(".movie").css({
                    width: $(window).width(),
                    height: $(window).height()
                });
        $(".video-button").on("click",function(){
            $(".movie").fadeIn(400);
                var videoName = $(this).data("videoname")
                var videoResource

                switch(videoName)
                {
                  case "introduce":
                    videoResource = "http://video.zbqibing.com/fa9849c151de4f68ba1b05c42f64f533/d1625416614f409d907721c228182c5b-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "game":
                    videoResource = "http://video.zbqibing.com/112b38c074da42778575e4d9d984f720/56b2fe32f4f747859ddec058b9d17597-5456d705cfd07e668f702e78be66cb6f.mp4"
                    break;
                  case "zhuanshang":
                    videoResource = "http://video.zbqibing.com/404ce58f1fc0493b857fbc46ee512c70/125d46adb78b46f78689de239b4eb019-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "zengxiao":
                    videoResource = "http://video.zbqibing.com/371ad2955de5495ea8cc3af90b28f9ad/29d344afabec4fe39f849f7a33a498ae-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "xiaohao":
                    videoResource = "http://video.zbqibing.com/754f8ce331a44e629d097a01bbf41c0d/ccf617070d29457ba32dc28f7d27496e-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "wanduo":
                    videoResource = "http://video.zbqibing.com/17080317ff544da380c1d74485b0b315/253ca784995e414b9253d61d2ac2290d-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "toutian":
                    videoResource = "http://video.zbqibing.com/64528aebb7e141609b425d036884dd9c/3f789bdac9af4ed9a5f8b54efc1ac73a-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "shikong":
                    videoResource = "http://video.zbqibing.com/abe72af3ef39443ab191de561302e806/ffc8e6f2f6d745b3a28adda8044281a9-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "pofang":
                    videoResource = "http://video.zbqibing.com/80149c1a928b412d98ee2b56255e6515/57c7497d28fd4911ba4bee506089a128-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "juedou":
                    videoResource = "http://video.zbqibing.com/d88973a6b9904b1db1f27957d52181b4/f2b102df0f474a809e0372cadb549ddc-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "jingu":
                    videoResource = "http://video.zbqibing.com/c03fc1bc504440e3b1860a357ec21e8f/efb4677c95b14f1ba286089ed0a595c2-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "huanshi":
                    videoResource = "http://video.zbqibing.com/0059fbf63a09404fadad813bec18918b/f733aaa81c6b495da19f2b4111f3f809-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "duoyao":
                    videoResource = "http://video.zbqibing.com/2f997aaaae7044039de3759856d0abbc/547892d4ac8847899518c735acfc8e56-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  case "chihuan":
                    videoResource = "http://video.zbqibing.com/43f17a9e350b4e3b873421e1b35830d5/591668a53fc048c4b3f2d83f95cd46c4-bebed62c6b6ebe8977b46266f0584fdc.mp4"
                    break;
                  default:
                  
                }
                var src = videoResource
            $("#publicvideo").attr("src", src)
            // console.log($("video")[0].autoplay)
            $("#publicvideo")[0].play();
            $(".movie .movie-kuang").css({
                        height: $("#publicvideo").height()
                    });

        })        
        $(".movie-close-button").on("click",function(){
            $(".movie").fadeOut(400);
            $("#publicvideo")[0].pause();
        })




        // 第二屏手风琴
        $(".feature ul li").on("click", function(){
            if($(this).hasClass("active")){
                $(this).siblings().removeClass("hover").addClass("active")
                $(this).removeClass("active").addClass("hover")
            }
            $(this).siblings().toggleClass("active")
            $(this).toggleClass("hover")
        })

        // $(".feature ul li").on("mouseleave", function(){
        //     $(this).siblings().removeClass("active")
        //     $(this).removeClass("hover")
        // })

        /*基础要点*/

        $(".pointList .points").on("mouseenter", function(){
            var idx = $(".pointList .points").index(this)
            idx = idx + 1;
            $(".pointsDetails").stop(false, true).fadeIn(500)
            $(".pointsDetails li:nth-child(" +  idx  + ")").stop(false, true).show()
        })
        $(".pointList .points").on("mouseleave", function(){
            var idx = $(".pointList .points").index(this)
            idx = idx + 1;
            $(".pointsDetails").stop(false, true).fadeOut(500)
            $(".pointsDetails li:nth-child(" +  idx  + ")").stop(false, true).hide()
        })
        
        /*计谋介绍*/ 
        // 卡牌列表
        $(".attack").on("click", function(){
            $(".sliderPop").addClass("active")
            $(".attack-list").show();
            $(".defanse-list").hide();
            $(".control-list").hide();
        })
        $(".defanse").on("click", function(){
            $(".sliderPop").addClass("active")
            $(".attack-list").hide();
            $(".defanse-list").show();
            $(".control-list").hide();
        })
        $(".control").on("click", function(){
            $(".sliderPop").addClass("active")
            $(".attack-list").hide();
            $(".defanse-list").hide();
            $(".control-list").show();
        })
        //卡牌列表开关
        $(".sliderPop-switch").on("click", function(){
            $(".sliderPop").toggleClass("active")
        })

        //单张某种类型卡牌详情
        $(".look-attack-list").on("click", function(){
            $(".carddetails").fadeIn()
            $("#attackSlider").fadeIn()
            $("#defanseSlider").fadeOut()
            $("#controlSlider").fadeOut()
        })
        $(".look-defanse-list").on("click", function(){
            $(".carddetails").fadeIn()
            $("#attackSlider").fadeOut()
            $("#defanseSlider").fadeIn()
            $("#controlSlider").fadeOut()
        })
        $(".look-control-list").on("click", function(){
            $(".carddetails").fadeIn()
            $("#attackSlider").fadeOut()
            $("#defanseSlider").fadeOut()
            $("#controlSlider").fadeIn()
        })



        $(".btn-closeCarddetails").on("click", function(){
            $(".trick .carddetails").fadeOut();
        })
        var cardList = [[
            {
               type: "进攻类卡牌",   //类型
               rarity: "普通",    //稀有度
               target: "单体",    //目标
               name: "催能符", //名字
               describe: "与对手比拼最大秘钥，秘钥数字大者夺取对方30%秘钥。",    //
               attack: 45,  //攻击
               defense: 2, //防御
               control: 2, //控制
               cooling: 3,  //冷却
               
            },{

            }
        ],[],[]]

})